#include <iostream>
using namespace std;

class Time {
private:
    int hour;
    int minute;
    int second;
    void normalize() {
        minute += second / 60;
        second %= 60;
        if (second < 0) {
            second += 60;
            minute--;
        }
        hour += minute / 60;
        minute %= 60;
        if (minute < 0) {
            minute += 60;
            hour--;
        }
        hour = (hour + 24) % 24; 
    }

public:
    Time() : hour(0), minute(0), second(0) {}
    Time(int h, int m, int s) : hour(h), minute(m), second(s) {}
    friend istream& operator>>(istream& in, Time& t) {
        in >> t.hour >> t.minute >> t.second;
        return in;}

    friend ostream& operator<<(ostream& out, const Time& t) {
        out << (t.hour < 10? "0" : "") << t.hour << ":" << (t.minute < 10? "0" : "") << t.minute << ":" << (t.second < 10? "0" : "") << t.second;
        return out;
    }

    Time& operator+=(const Time& other) {
        this->second += other.second;
        this->minute += other.minute;
        this->hour += other.hour;
        this->normalize();
        return *this;
    }
    Time& operator-=(const Time& other) {
        this->second -= other.second;
        this->minute -= other.minute;
        this->hour -= other.hour;
        this->normalize();
        return *this;
    }

    Time& operator++() {
        this->second++;
        this->normalize();
        return *this;
    }
    Time operator++(int) {
        Time temp = *this;
        ++(*this);
        return temp;
    }
    Time& operator--() {
        this->second--;
        this->normalize();
        return *this;
    }
    Time operator--(int) {
        Time temp = *this;
        --(*this);
        return temp;
    }
};

int main() {
    Time time1, time2;
    cin >> time1 >> time2;
    cout << (time1 += (time2++)) << endl;
    cout << (time1 -= time2) << endl;
    cout << (++time2) << endl;
    cout << (time2 += (time1--)) << endl;
    cout << (--time1) << endl;
    cout << (time2 -= time1) << endl;
    return 0;
}